<template>
  <div id="app">
    <button @click="normalCount = 10000">生成10000个普通组件</button>
    <button @click="functionalCount = 10000">生成10000个函数组件</button>

    <div class="container">
      <div class="item">
        <NormalComp v-for="n in normalCount" :key="n" :count="n"></NormalComp>
      </div>
      <div class="item">
        <FunctionalComp v-for="n in functionalCount" :key="n" :count="n"></FunctionalComp>
      </div>
    </div>
  </div>
</template>

<script>
import NormalComp from "./components/NormalComp.vue";
import FunctionalComp from "./components/FunctionalComp.vue";
export default {
  components: { NormalComp, FunctionalComp },
  data() {
    return {
      normalCount: 0,
      functionalCount: 0,
    };
  },
  mounted() {
    window.vm = this;
  },
};
</script>

<style>
#app {
  text-align: center;
}

#app .container {
  display: flex;
  align-items: center;
  justify-content: center;
}

#app .container .item {
  flex: 1;
  border: 1px solid #ccc;
}
</style>
